package com.wandian.cqcsk.adapter.mine;

import android.widget.TextView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.mylib.libcore.utils.UIUtils;
import com.wandian.cqcsk.R;
import com.wandian.setting.bean.CoinHistoryBean;

/**
 * @author Administrator
 * @date 2019/12/16-13:32
 * @description MyTXHistoryRecycleAdapter
 **/
public class MyTXHistoryRecycleAdapter extends BaseQuickAdapter<CoinHistoryBean, BaseViewHolder> {

    public MyTXHistoryRecycleAdapter(int layoutResId) {
        super(layoutResId);
    }


    @Override
    protected void convert(BaseViewHolder helper, CoinHistoryBean item) {

        TextView tv_type = helper.getView(R.id.tv_type);
        TextView tv_coin_time = helper.getView(R.id.tv_coin_time);
        TextView tv_coin = helper.getView(R.id.tv_coin);
        TextView tv_coin_number = helper.getView(R.id.tv_coin_number);

        tv_type.setText("金币来源:"+item.getAdvertName());
        tv_coin_time.setText("创建时间:"+item.getCreateTime());
        tv_coin.setText("钱包金币："+item.getGold()+"");

        if(!UIUtils.isEmpty(item.getGold()) && item.getGold()>=0){
            tv_coin_number.setTextColor(mContext.getResources().getColor(R.color.color_red_money));
            tv_coin_number.setText("+"+item.getGold());
        }else {
            tv_coin_number.setTextColor(mContext.getResources().getColor(R.color.text_green));
            tv_coin_number.setText("-"+item.getGold());
        }
    }
}
